package Demo2;

import java.util.Scanner;

//计算最后一个单词的长度
public class Test {
    public static int func(String s){
        int ret = s.lastIndexOf(" ");
        String s1 = s.substring(ret+1);
        return s1.length();
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        System.out.println(func(s));
    }
}
